<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>播放音频</title>
	<link href="css/Audio.css" type="text/css">
</head>
<body>
<video id="video1" style="background-color: red">
	<source src="./video/man.mp3">
</video>
<button id="BeginButton" onclick="play()">开始</button>
<button id="PauseButton" onclick="pause()">暂停</button>
<audio src="./video/man.mp3" controls="controls">
	Your browser does not support the audio element.
</audio>

<a href="./video/man.mp3">Play Sound</a>
<script>
	var video = document.getElementById('video1');
	function play() {
		video.play();
	}
	function pause() {
		video.pause();
	}
</script>
<script src="http://mediaplayer.yahoo.com/latest"></script>

<script>
	var flag = 0, //flash  是否加载完毕
		flashObj;//本地页面的falsh 对象

	var kgPlay = {
		// 是否支持audio
		support_audio: function() {
			return !!document.createElement('audio').canPlayType;
		},
		//获取flash对象
		getFlashMovieObject: function(movieName) {
			if (document[movieName]) {
				return document[movieName];
			} else if (navigator.appName.indexOf("Microsoft Internet") == -1) {
				if (document.embeds && document.embeds[movieName]) {
					return document.embeds[movieName];
				}
			} else if (window[movieName]) {
				return window[movieName];
			} else {
				return document.getElementById(movieName);
			}
		},
		// firefox获取flash
		getSWF: function(name) {
			var e = document.getElementById(name);
			return (navigator.appName.indexOf("Microsoft") != -1) ? e : e.getElementsByTagName("embed")[0];
		}
	};
	//表示flash加载完成，并初始化
	function flashloaded() {
		if (navigator.userAgent.toLowerCase().indexOf("firefox") != -1) {
			flashObj = kgPlay.getSWF("AudioPlayer3");
		} else {
			flashObj = kgPlay.getFlashMovieObject("AudioPlayer3");
		}
		flag = 1;
	}


	var apmCollectData = apmCollectData || [];
	if (kgPlay.support_audio()) {
		flag = 0;
		flashloaded = null;
		//删除flash
		$("#fobj").remove();
		var playbyAudio = document.createElement("script");
		playbyAudio.charset = "UTF-8";
		playbyAudio.src = "http://www.kugou.com/yy/static/js/play/playbyAudio.js?now="+new Date().getTime();
		var byAudio = document.getElementsByTagName("script")[0];
		byAudio.parentNode.insertBefore(playbyAudio, byAudio);
	} else {
		$(".myAudiohide").hide();
		var playForFlash = document.createElement("script");
		playForFlash.charset = "UTF-8";
		playForFlash.src = "http://www.kugou.com/yy/static/js/play/playbyFlash.js?now="+new Date().getTime();
		var byFlash = document.getElementsByTagName("script")[0];
		byFlash.parentNode.insertBefore(playForFlash, byFlash);
	}
	var kguser = document.createElement("script");
	kguser.charset = "UTF-8";
	kguser.src = "http://login-user.kugou.com/v1/kguser_min.js?now="+new Date().getTime();
	var kguserScript = document.getElementsByTagName("script")[0];
	kguserScript.parentNode.insertBefore(kguser, kguserScript);
</script>
</body>
</html>